<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@page import="java.util.Calendar"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

<div id="event_board_calendar" class="event_board_calendar">

	<p class="align_c"><s:property value="nav" escape="false" /></p>
	<p class="align_c"><s:property value="today" escape="false" /></p>

	<!-- 달력표시 -->
	<table class="calendar">
	<colgroup>
		<col width="14%" />
		<col width="14%" />
		<col width="14%" />
		<col width="14%" />
		<col width="14%" />
		<col width="14%" />
		<col width="14%" />
	</colgroup>
	<tr>
		<th>sun</th>
		<th>mon</th>
		<th>tue</th>
		<th>wen</th>
		<th>thr</th>
		<th>fri</th>
		<th>sat</th>
	</tr>
	<c:forEach var="day" begin="1" end="${week-1}">
		<td>
			<%-- ${week-1}
			${endDay}
			${nowYear}
			${nowMonth}
			${nowDay}
			${year}
			${month} --%>
		</td>
	</c:forEach>
	<c:forEach var="day" begin="1" end="${endDay}" varStatus="stat">
		<c:if test="${(nowYear==year)&&(nowMonth==month)&&(nowDay==day)}"><td class="today"></c:if>
		<c:if test="${(nowYear!=year)||(nowMonth!=month)||(nowDay!=day)}"><td></c:if>
			<c:if test="${(stat.count+week-1)%7==0 }">	<font color=green>	</c:if>
			<c:if test="${(stat.count+week-1)%7==1 }">	<font color=red>	</c:if>${day}</font>
			<c:forEach var="list" items="${eventlistAll}">
			<c:if test="${(list.eventdate_M==month)&&(list.eventdate_D==day)}">
				<s:if test="#session.session_id == null">
				<p><b>- ${list.subject}</b><br/></p>
				</s:if>
				<s:else>
				<p><b><a href="EviewAction.action?no=${list.no}">- ${list.subject}</a></b><br/></p>
				</s:else>
			</c:if>
			</c:forEach>
		</td>
		<c:if test="${(stat.count+week-1)%7==0 }"></tr><tr></c:if>
	</c:forEach><!-- day -->	
	<c:forEach var="i" begin="1" end="${(7-((endDay+week-1) % 7))%7}">
		<td></td>
	</c:forEach>
	</table>
</div><!-- //event_board_calendar -->